﻿@using RiverCruise.Helpers
@model RiverCruise.Models.Home.AdvalvasModel

<div class="list-group">
    @foreach (var advalvas in Model.Advalvas)
    {
        <span class="list-group-item list-group-item-danger">
            <span class="glyphicon glyphicon-warning-sign pull-left"></span>&nbsp;
            @advalvas.Title
            @if (Roles.IsUserInRole(RoleHelper.Edit))
            { 
                using (Html.BeginForm("Delete", "AdvalvasManagement", FormMethod.Post, new { @Class = "triggerModal pull-right", data_rc_ModalAction = "DeleteGet", data_rc_ModalController = "AdvalvasManagement" }))
                {
                    @Html.AntiForgeryToken();
                    <input type="hidden" value="@advalvas.Id" name="Id" id="Id" />
                    <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-trash"></span></button>
                }
            }
            <span class="clearfix"></span>
        </span>
    }
</div>


@if(Roles.IsUserInRole(RoleHelper.Edit))
{
    <div class="btn-group btn-group-justified">
        <a class="btn btn-success" href="@Url.Action("Add", "AdvalvasManagement")">
            <span class="glyphicon glyphicon-plus"></span>
            New
        </a>
    </div>
}